/**
 * iview-admin中meta除了原生参数外可配置的参数:
 * meta: {
 *  title: { String|Number|Function }
 *         显示在侧边栏、面包屑和标签栏的文字
 *         使用'{{ 多语言字段 }}'形式结合多语言使用，例子看多语言的路由配置;
 *         可以传入一个回调函数，参数是当前路由对象，例子看动态路由和带参路由
 *  hideInBread: (false) 设为true后此级路由将不会出现在面包屑中，示例看QQ群路由配置
 *  hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项
 *  notCache: (false) 设为true后页面在切换标签后不会缓存，如果需要缓存，无需设置这个字段，而且需要设置页面组件name属性和路由配置的name一致
 *  views: (null) 可访问该页面的权限数组，当前路由设置的权限会影响子路由
 *  icon: (-) 该页面在左侧菜单、面包屑和标签导航处显示的图标，如果是自定义图标，需要在图标名称前加下划线'_'
 *  beforeCloseName: (-) 设置该字段，则在关闭当前tab页时会去'@/router/before-close.js'里寻找该字段名对应的方法，作为关闭前的钩子函数
 * }
 */


export default [
  {path: '*', redirect: "/404", meta: {hideInMenu: true}},
  {
    path: '/', name: "_login",
    meta: {title: '登录', keepAlive: false, hideInMenu: true},
    component: () => import('@/components/main/login.vue')
  },
  // {
  //   path: '/main', name: "_main",
  //   meta: {title: '主体', requiresAuth: true, keepAlive: false, hideInMenu: true},
  //   component: () => import('@/components/main/main.vue')
  // },
  /*
  * hideInBread：true 不会显示上级菜单标题
   * false  显示上级
   * children < 1 还是会显示上级
  * */
  // {
  //   path: '', name: "_home1",
  //   component: () => import('@/components/main/main.vue'),
  //   meta: {hideInBread: true, keepAlive: false, title: '数据概览1', icon: 'fa fa-home'},
  //   children: [
  //     {
  //       path: '/home',
  //       name: "home",
  //       meta: {
  //         title: '首页',
  //         requiresAuth: true,
  //         keepAlive: false,
  //         icon: 'fa fa-home',
  //         views: ['data:overview:dept']
  //       },
  //       component: () => import('@/components/main/home.vue')
  //     },
  //   ]
  // },
  {
    path: '', name: "_home",
    component: () => import('@/components/main/main.vue'),
    meta: {hideInBread: true, keepAlive: false, title: '首页', icon: 'fa fa-home'},
    children: [
      {
        path: '/home', name: "home",
        meta: {
          title: '首页', requiresAuth: true, keepAlive: false, icon: 'fa fa-home',
          // views: ['manage:company:index:view']
        },
        component: () => import('@/components/main/home.vue')
      }
    ]
  },

  ///////////////基本信息/////////////////////
  {
    path: '', name: "_basicInformation",
    component: () => import('@/components/main/main.vue'),
    meta: {hideInBread: true, keepAlive: false, title: '基本信息', icon: 'fa fa-home'},
    children: [
      {
        path: '/transportVehicle', name: "transportVehicle",
        meta: {
          title: '运输车辆', requiresAuth: true, keepAlive: false, icon: 'fa fa-car', views: ['manage:basic:vehicle:view']
        },
        component: () => import('@/components/transportVehicle/transportVehicle.vue')
      },
      {
        path: '/freightCapes', name: "freightCapes",
        meta: {
          title: '货运挂车', requiresAuth: true, keepAlive: false, icon: 'fa fa-truck', views: ['manage:basic:trailer:view']
        },
        component: () => import('@/components/freightCapes/freightCapes.vue')
      },
      {
        path: '/employee', name: "employee",
        meta: {
          title: '从业人员',
          requiresAuth: true,
          keepAlive: false,
          icon: 'fa fa-drivers-license',
          views: ['manage:basic:driver:view']
        },
        component: () => import('@/components/employee/employee.vue')
      }
    ]
  },
  ///////////////机务维护/////////////////////
  {
    path: '', name: "_maintenanceMaintenance",
    component: () => import('@/components/main/main.vue'),
    meta: {hideInBread: true, title: '机务维护', icon: 'fa fa-bell'},
    children: [
      {
        path: '/transferOwnership', name: "transferOwnership",
        meta: {
          title: '过户管理',
          requiresAuth: true,
          keepAlive: false,
          icon: 'fa fa-balance-scale',
          views: ['manage:transfer:view']
        },
        component: () => import('@/components/transferOwnership/transferOwnership.vue')
      },
      {
        path: '/insurance', name: "insurance",
        meta: {
          title: '保险管理', requiresAuth: true, keepAlive: false, icon: 'fa fa-archive', views: ['manage:insurance:view']
        },
        component: () => import('@/components/insurance/insurance.vue')
      },
      {
        path: '/annualInspection', name: "annualInspection",
        meta: {
          title: '年检管理',
          requiresAuth: true,
          keepAlive: false,
          icon: 'fa fa-institution',
          views: ['manage:annualInspect:view']
        },
        component: () => import('@/components/expire/annualInspection.vue')
      },
      {
        path: '/service', name: "service",
        meta: {
          title: '营运证管理',
          requiresAuth: true,
          keepAlive: false,
          icon: 'fa fa-car',
          views: ['manage:operationCertificate:view']
        },
        component: () => import('@/components/expire/service.vue')
      },
      {
        path: '/maintenance', name: "maintenance",
        meta: {
          title: '维保管理', requiresAuth: true, keepAlive: false, icon: 'fa fa-wrench', views: ['manage:maintain:view']
        },
        component: () => import('@/components/expire/maintenance.vue')
      },
      {
        path: '/tallage', name: "tallage",
        meta: {
          title: '挂车车船税管理',
          requiresAuth: true,
          keepAlive: false,
          icon: 'fa fa-bus',
          views: ['manage:trailerVesselTax:view']
        },
        component: () => import('@/components/expire/tallage.vue')
      },
      {
        path: '/scrap', name: "scrap",
        meta: {
          title: '报废管理', requiresAuth: true, keepAlive: false, icon: 'fa fa-trash-o', views: ['manage:scrap:view']
        },
        component: () => import('@/components/scrap/scrap.vue')
      },
      {
        path: '/expirationReminder', name: "expirationReminder",
        meta: {
          title: '到期提醒', requiresAuth: true, keepAlive: false, icon: 'fa fa-bell', views: ['manage:expire:view']
        },
        component: () => import('@/components/expirationReminder/expirationReminder.vue')
      },
      {
        path: '/expenseCalendar', name: "expenseCalendar",
        meta: {
          title: '短信消费记录', requiresAuth: true, keepAlive: false, icon: 'fa fa-money', views: ['manage:smsConsume:view']
        },
        component: () => import('@/components/expenseCalendar/expenseCalendar.vue')
      }
    ]
  },

  //////////////////运营监控/////////////////////
  {
    path: '', name: "_operationMonitoring",
    component: () => import('@/components/main/main.vue'),
    meta: {hideInBread: false, title: '运营监控', icon: 'fa fa-camera'},
    children: [
      {
        path: '/police', name: "police",
        meta: {
          title: '实时报警',
          requiresAuth: true,
          keepAlive: false,
          icon: 'fa fa-warning',
          views: ['manage:operationMonitoring:alarm:today:view']
        },
        component: () => import('@/components/operationMonitoring/police.vue')
      },
      {
        path: '/site',
        name: "site",
        meta: {
          title: '实时位置',
          requiresAuth: true,
          keepAlive: false,
          icon: 'fa fa-map-marker',
          views: ['manage:operationMonitoring:location:view']
        },
        component: () => import('@/components/operationMonitoring/site.vue')
      },
      {
        path: '/alarmParameter',
        name: "alarmParameter",
        meta: {
          title: '报警台账',
          requiresAuth: true,
          keepAlive: false,
          icon: 'fa fa-list',
          views: ['manage:operationMonitoring:alarm:view']
        },
        component: () => import('@/components/operationMonitoring/alarmParameter.vue')
      },
      {
        path: '/offLineParameter',
        name: "offLineParameter",
        meta: {
          title: '离线台账',
          requiresAuth: true,
          keepAlive: false,
          icon: 'fa fa-list',
          views: ['manage:operationMonitoring:offline:view']
        },
        component: () => import('@/components/operationMonitoring/offLineParameter.vue')
      },
      {
        path: '/operatingMileage',
        name: "operatingMileage",
        meta: {
          title: '运营里程',
          requiresAuth: true,
          keepAlive: false,
          icon: 'fa fa-map-signs',
          views: ['manage:operationMonitoring:position:view']
        },
        component: () => import('@/components/operationMonitoring/operatingMileage.vue')
      },
    ]
  },
  //////////////////系统管理/////////////////////
  {
    path: '', name: "_system",
    component: () => import('@/components/main/main.vue'),
    meta: {hideInBread: false, title: '系统管理', icon: 'fa fa-gear'},
    children: [
      {
        path: '/dict',
        name: "dict",
        meta: {
          title: '字典管理',
          requiresAuth: true,
          keepAlive: false,
          icon: 'fa fa-th-large',
          views: ['manage:sys:dict']
        },
        component: () => import('@/components/system/dict.vue')
      },
      {
        path: '/noteLimit',
        name: "noteLimit",
        meta: {
          title: '短信额度',
          requiresAuth: true,
          keepAlive: false,
          icon: 'fa fa-money',
          views: ['manage:sys:sms']
        },
        component: () => import('@/components/system/noteLimit.vue')
      },
    ]
  },
  //////////////////安全生产/////////////////////
  {
    path: '',
    name: "_TraiReco",
    component: () => import('@/components/main/main.vue'),
    meta: {hideInBread: false, title: '安全生产', icon: 'fa fa-cube',},
    children: [
      {
        path: '/organization',
        name: "organization",
        meta: {
          title: '企业组织架构',
          requiresAuth: true,
          keepAlive: false,
          icon: 'fa fa-money',
          // views: ['manage:sys:sms']
        },
        component: () => import('@/components/safety/OverallOrgan.vue')
      },
      {
        path: '/qualification',
        name: "qualification",
        meta: {
          title: '资质证明',
          requiresAuth: true,
          keepAlive: false,
          icon: 'fa fa-money',
          // views: ['manage:sys:sms']
        },
        component: () => import('@/components/safety/Qualification.vue')
      },
      {
        path: '/safetyGoal',
        name: "safetyGoal",
        meta: {
          title: '安全目标',
          requiresAuth: true,
          keepAlive: false,
          icon: 'fa fa-money',
          // views: ['manage:sys:sms']
        },
        component: () => import('@/components/safety/safetyGoal.vue')
      },
      {
        path: '/securityFunds',
        name: "securityFunds",
        meta: {
          title: '安全经费',
          requiresAuth: true,
          keepAlive: false,
          icon: 'fa fa-money',
          // views: ['manage:sys:sms']
        },
        component: () => import('@/components/safety/securityFunds.vue')
      },
      {
        path: '/safetyMeetings',
        name: "safetyMeetings",
        meta: {
          title: '安全例会',
          requiresAuth: true,
          keepAlive: false,
          icon: 'fa fa-money',
          // views: ['manage:sys:sms']
        },
        component: () => import('@/components/safety/SafetyMeetings.vue')
      },
      {
        path: '',
        name: "_safetyTraining",
        //如果三级 不要 component字段
        // component: () => import('@/components/main/main.vue'),
        meta: {hideInBread: false, title: '安全培训', icon: 'fa fa-cube',},
        children: [
          {
            path: '/preJobTraining',
            name: "preJobTraining",
            meta: {
              title: '岗前培训',
              requiresAuth: true,
              keepAlive: false,
              icon: 'fa fa-money',
              // views: ['manage:sys:sms']
            },
            component: () => import('@/components/safetyTraining/preJobTraining.vue')
          },
          {
            path: '/dailyTraining',
            name: "dailyTraining",
            meta: {
              title: '日常培训',
              requiresAuth: true,
              keepAlive: false,
              icon: 'fa fa-money',
              // views: ['manage:sys:sms']
            },
            component: () => import('@/components/safetyTraining/dailyTraining.vue')
          },
          {
            path: '/specialSkillTraining',
            name: "specialSkillTraining",
            meta: {
              title: '专项培训',
              requiresAuth: true,
              keepAlive: false,
              icon: 'fa fa-money',
              // views: ['manage:sys:sms']
            },
            component: () => import('@/components/safetyTraining/specialSkillTraining.vue')
          },
        ]
      },


      {
        path: '',
        name: "_nearMissIdentification",
        //如果三级 不要 component字段
        // component: () => import('@/components/main/main.vue'),
        meta: {hideInBread: false, title: '隐患排查', icon: 'fa fa-cube',},
        children: [
          {
            path: '/routineScreening',
            name: "routineScreening",
            meta: {
              title: '日常排查',
              requiresAuth: true,
              keepAlive: false,
              icon: 'fa fa-money',
              // views: ['manage:sys:sms']
            },
            component: () => import('@/components/nearMissIdentification/routineScreening.vue')
          },
          {
            path: '/monthlyScreening',
            name: "monthlyScreening",
            meta: {
              title: '月度排查',
              requiresAuth: true,
              keepAlive: false,
              icon: 'fa fa-money',
              // views: ['manage:sys:sms']
            },
            component: () => import('@/components/nearMissIdentification/monthlyScreening.vue')
          },
          {
            path: '/quarterScreening',
            name: "quarterScreening",
            meta: {
              title: '季度排查',
              requiresAuth: true,
              keepAlive: false,
              icon: 'fa fa-money',
              // views: ['manage:sys:sms']
            },
            component: () => import('@/components/nearMissIdentification/quarterScreening.vue')
          },
          {
            path: '/fireScreen',
            name: "fireScreen",
            meta: {
              title: '消防排查',
              requiresAuth: true,
              keepAlive: false,
              icon: 'fa fa-money',
              // views: ['manage:sys:sms']
            },
            component: () => import('@/components/nearMissIdentification/fireScreen.vue')
          },
          {
            path: '/comprehensiveScreening',
            name: "comprehensiveScreening",
            meta: {
              title: '综合排查',
              requiresAuth: true,
              keepAlive: false,
              icon: 'fa fa-money',
              // views: ['manage:sys:sms']
            },
            component: () => import('@/components/nearMissIdentification/comprehensiveScreening.vue')
          },
        ]
      },


      {
        path: '/personnelFile',
        name: "personnelFile",
        meta: {
          title: '人员档案',
          requiresAuth: true,
          keepAlive: false,
          icon: 'fa fa-money',
          // views: ['manage:sys:sms']
        },
        component: () => import('@/components/safety/personnelFile.vue')
      },
      {
        path: '/vehicleFiles',
        name: "vehicleFiles",
        meta: {
          title: '车辆档案',
          requiresAuth: true,
          keepAlive: false,
          icon: 'fa fa-money',
          // views: ['manage:sys:sms']
        },
        component: () => import('@/components/safety/vehicleFiles.vue')
      },
      // {
      //   path: '/curriculum',
      //   meta: {
      //     title: '课程培训记录',
      //     requiresAuth: true,
      //     keepAlive: false,
      //     icon: 'fa fa-bookmark ',
      //     // views: ['educ:record:train']
      //   },
      //   name: "curriculum",
      //   component: () => import('@/components/TraiReco/curriculum.vue')
      // },
      // {
      //   path: '/Exam',
      //   meta: {
      //     title: '考试测验记录',
      //     requiresAuth: true,
      //     keepAlive: false,
      //     icon: 'fa fa-bookmark-o ',
      //     // views: ['educ:record:exam']
      //   },
      //   name: "Exam",
      //   component: () => import('@/components/TraiReco/Exam.vue')
      // }
    ]
  },

  ///////////////////////////////////////////////////////////////////////////////////////////
  {
    path: '/401', name: 'error_401', meta: {hideInMenu: true},
    component: () => import('@/components/error-page/401.vue')
  },
  {
    path: '/500', name: 'error_500', meta: {hideInMenu: true},
    component: () => import('@/components/error-page/500.vue')
  },
  {
    path: '/404', name: 'error_404', meta: {hideInMenu: true},
    component: () => import('@/components/error-page/404.vue')
  }
];
